package org.agridata.akvisualization.service.appoint.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.agridata.akvisualization.doMain.appoint.dto.TCheckResultDto;
import org.agridata.akvisualization.doMain.appoint.vo.TCheckResultVo;
import org.agridata.akvisualization.mapper.appoint.TCheckResultMapper;
import org.agridata.akvisualization.result.Result;
import org.agridata.akvisualization.service.appoint.TCheckResultService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TCheckResultServiceImpl implements TCheckResultService {

    @Autowired
    private TCheckResultMapper mapper;

    @Override
    public Result checkRecordsSelect(TCheckResultDto resultDto) {
        try {
            Page<TCheckResultVo> page = new Page<>(resultDto.getPageNo(), resultDto.getPageSize());
            Page<TCheckResultVo> resultListPage = mapper.selectTCheckResultListPage(page, resultDto);
            return Result.ok(resultListPage);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.fail("出现异常！");
        }
    }
}
